Skip to main content

Deploy Container to DigitalOcean from Github Actions

Follow this for more secure approach

  • Create a new droplet
  • Generate a new SSH key in the local machine
ssh-keygen
  • Copy the public key and create a new SSH key in droplet using the public key
wl-copy < .ssh/digitalocean.pub
  • Tell ssh to use digitalocean private key when connecting to droplet ip
# ~/.ssh/config

Host xxx.xxx.xxx.xxx
HostName xxx.xxx.xxx.xxx
User root
IdentityFile /home/s1n7ax/.ssh/digitalocean
  • Test the connection
# following should ask to to add the key to the known hosts for the first time
# you should be able to log in to the droplet

ssh xxx.xxx.xxx.xxx
  • Create a secret in GitHub for the SSH private key
wl-copy < .ssh/digitalocean.pub